#pragma once
#include "iftpagent.h"

#include "MyInternetSession.h"

class CMFCFTPClient :
	public IFTPAgent
{
public:

	CMFCFTPClient(void);
	~CMFCFTPClient(void);

public:

	virtual bool Login(TCHAR* pHost, TCHAR* pUser, TCHAR* pPwd, UINT32 nPort);
	virtual bool Logout();
	virtual bool MakeDirectory(TCHAR strDirectory[MAX_PATH]);
	virtual bool IsFileExist(TCHAR strFilePath[MAX_PATH]);
	virtual bool UploadFile(TCHAR szLocalFile[MAX_PATH], TCHAR szRemoteFile[MAX_PATH]);
	virtual bool DownloadFile(TCHAR szRemoteFile[MAX_PATH], TCHAR szLocalFile[MAX_PATH],int iTimeOut = 0);
	virtual	bool Rename(TCHAR szCurrentFileName[MAX_PATH], TCHAR szNewFileName[MAX_PATH]);
	virtual bool Remove(TCHAR szFileName[MAX_PATH]);

protected:

	CMyInternetSession	m_session;
	CFtpConnection*		m_pFTPConnection;
	CRITICAL_SECTION	m_cs;
};

